import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  // {
  //   title: '用户id',
  //   align: "center",
  //   dataIndex: 'userId'
  // },
  {
    title: '用户名称',
    align: "center",
    dataIndex: 'userName'
  },
  // {
  //   title: '部门id',
  //   align: "center",
  //   dataIndex: 'departId'
  // },
  // {
  //   title: '部门名称',
  //   align: "center",
  //   dataIndex: 'departName'
  // },
  // {
  //   title: '考试id',
  //   align: "center",
  //   dataIndex: 'examId'
  // },
  {
    title: '考试标题',
    align: "center",
    dataIndex: 'examTitle'
  },
  {
    title: '考试时长',
    align: "center",
    dataIndex: 'examTime'
  },
  // {
  //   title: '用户时长',
  //   align: "center",
  //   dataIndex: 'userTime'
  // },
  {
    title: '试卷总分',
    align: "center",
    dataIndex: 'examScore'
  },
  {
    title: '及格分数',
    align: "center",
    dataIndex: 'passScore'
  },
  {
    title: '用户得分',
    align: "center",
    dataIndex: 'userScore'
  },
  {
    title: '试卷状态',
    align: "center",
    dataIndex: 'state'
  },
  // {
  //   title: '截至时间',
  //   align: "center",
  //   dataIndex: 'limitTime'
  // },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "用户名称",
    field: 'userName',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    label: "考试标题",
    field: 'examTitle',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户id',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '用户名称',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '部门id',
    field: 'departId',
    component: 'Input',
  },
  {
    label: '部门名称',
    field: 'departName',
    component: 'Input',
  },
  {
    label: '考试id',
    field: 'examId',
    component: 'Input',
  },
  {
    label: '考试标题',
    field: 'examTitle',
    component: 'Input',
  },
  {
    label: '考试时长',
    field: 'examTime',
    component: 'InputNumber',
  },
  {
    label: '用户时长',
    field: 'userTime',
    component: 'InputNumber',
  },
  {
    label: '试卷总分',
    field: 'examScore',
    component: 'InputNumber',
  },
  {
    label: '及格分数',
    field: 'passScore',
    component: 'InputNumber',
  },
  {
    label: '用户得分',
    field: 'userScore',
    component: 'InputNumber',
  },
  {
    label: '试卷状态',
    field: 'state',
    component: 'Input',
  },
  {
    label: '截至时间',
    field: 'limitTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
